package order;

import pizza.BJCheesePizza;
import pizza.BJPepperPizza;
import pizza.Pizza;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: fzykd
 * Date: 2023-03-15
 * Time: 19:44
 */

public class BJOrderPizza extends OrderPizza{


    @Override
    Pizza createPizza(String orderType) {
        //子类来实现Pizza的创建过程
        Pizza pizza = null;
        if (orderType.equals("cheese")){
            pizza = new BJCheesePizza();
        }else if (orderType.equals("pepper")){
            pizza = new BJPepperPizza();
        }else {
            System.out.println("没有你要的披萨");
        }

        return pizza;
    }
}
